In [1]:
%matplotlib inline
import pylab as pl
import numpy as np
import commands
import scipy.stats
In [2]:
status, output = commands.getstatusoutput("make")
print 'Make output: \n', output, '\n\n'
N = 10000
K = 20.
output_fname = "output.dat"
command = "time ./ggmModel $RANDOM " + str(N) + " " + str(K) + " 1.0 " + output_fname
print "Running: \n", command + "\n"
status, output = commands.getstatusoutput(command)
print 'ggmModel output: \n----\n', output, '\n---\n'
In [3]:
Conns = np.loadtxt(output_fname)
print 'Data shape: ', Conns.shape
In [4]:
Degrees = np.zeros( (N), dtype=int)
C = Conns[:,0]
for j in range(N):
Degrees[j] = np.where(C == j)[0].shape[0]
In [5]:
print 'Mean degree: \t\t', Degrees.mean()
print 'Standard deviation: \t', Degrees.std()
In [11]:
pl.hist(Degrees, 10)
pl.show()